using System;

namespace Sagile.Nepma
{
    /// <summary>
    /// Interface for classes that have a task behaviour
    /// </summary>
    public interface IManageableTask
    {
        /// <summary>
        /// Occurs when task is finished
        /// </summary>
        event EventHandler<ManageableTaskEventArgs> Finished;

        /// <summary>
        /// Occurs when task is interrupted
        /// </summary>
        event EventHandler<ManageableTaskEventArgs> Aborted;

        /// <summary>
        /// Gets or sets the name of the task.
        /// </summary>
        /// <value>The name.</value>
        string Name
        {
            get;
            set;
        }

        /// <summary>
        /// Run the task.
        /// </summary>
        void Run();

        /// <summary>
        /// Stops the task.
        /// </summary>
        void Stop();
    }
}
